#include <iostream>
#include <queue>
#include <functional>
#include <cstring>

using namespace std;
class Person{
private:
    string name;
    int age;
public:
    Person(string n,int a):name(n),age(a){};
    string get_name(){return name;}
    int get_age(){return age;}
    bool operator<(const Person &p) const {
        if(p.age<age)
            return false;
        else
            return true;
    }
//    bool operator>(const Person &p) const {
//        return !(*this == p)&&!(*this<p);
//    }
};
int main() {
    Person p1[] = {Person("liushuai",28),Person("liudehua",30),Person("liangchaowei",38)};
    priority_queue<Person>pq1(p1,p1+3);
    if(!pq1.empty())
    {
        Person tmp = pq1.top();
        cout<<"name: "<<tmp.get_name()<<"\t"<<" age: "<<tmp.get_age()<<endl;
        pq1.pop();
    }
    return 0;
}